package com.ctg.payroll2.dao.cusadmin.impl;

import java.util.HashMap;
import java.util.List;

import com.ctg.payroll2.bean.po.CsProduct;
import com.ctg.payroll2.bean.po.PbCompany;
import com.ctg.payroll2.dao.cusadmin.PbCompanyDAO;
import com.ctg.platform.orm.ibatis.IbatisEntityDao;

@SuppressWarnings("unchecked")
public class PbCompanyDAOimpl extends IbatisEntityDao<PbCompany> implements
		PbCompanyDAO {

	public Integer primekeyByGeneral() {
		return (Integer) getSqlMapClientTemplate()
				.queryForObject("getprimekey");
	}

	public void insertCsPrpduct(CsProduct csProduct) {
		if (csProduct != null) {
			getSqlMapClientTemplate().insert("PbCompany.insert_csproduct",
					csProduct);
		}
	}

	public void deleteCsproductBycompanyCode(Object obj) {
		if (obj != null) {
			getSqlMapClientTemplate().insert(
					"PbCompany.deleteCsproductBycompanyCode", obj);
		}
	}

	public void insertstop_reason(HashMap<String, Object> paraMap) {

		getSqlMapClientTemplate()
				.insert("PbCompany.insertstop_reason", paraMap);
	}

	public List<HashMap<String, Object>> select_hisstop(
			HashMap<String, Object> paraMap) {
		List<HashMap<String, Object>> hisList = getSqlMapClientTemplate()
				.queryForList("PbCompany.select_hisstop", paraMap);
		return hisList;
	}

	public Boolean isSig(String company_code) {
		return (Integer) getSqlMapClientTemplate().queryForObject(
				"PbCompany.isSig", company_code) > 0 ? true : false;
	}

	public Boolean deleteCsKey(String company_code) {
		return getSqlMapClientTemplate().delete("PbCompany.deleteCsKey",
				company_code) > 0 ? true : false;
	}

	public void insertCsKey(HashMap<String, Object> insertMap) {
		getSqlMapClientTemplate().insert("PbCompany.insertCsKey", insertMap);
	}

}
